package com.szzg10.thinking.chapter18;

import java.io.File;
import java.io.FilenameFilter;

public class DirList3 {

	public static void main(String[] args) {
		String path = DirList3.class.getResource("").getPath();
		
		File file = new File(path);
		String[] names = file.list(new FilenameFilter() {
			@Override
			public boolean accept(File dir, String name) {
				return name.indexOf(".class") != -1 ? true : false;
			}
		});
		
		for(String element: names) {
			System.out.println(element);
		}
	}
}
